if __name__ == '__main__':
    # 登录程序，有三次输入账号、密码的机会，错误三次账号锁定
    users2 = "admin"
    passwd = "password"

    j = 3
    for i in range(3):
        username = input("请输入用户名：")
        password = input("请输入密码：")
        j -= 1
        if username != users2:
            print(f"用户名错误，您还有{j}次机会")
        elif password != passwd:
            print(f"密码错误，您还有{j}次机会")
        else:
            print("登陆成功!")
            break
    else:
        print("您没有机会登陆了")